package body Emplacements is

	function Get_Id_Plaque (E: Emplacement) return Natural is
	begin
		return E.Id_Plaque;
	end Get_Id_Plaque;
	
	function Get_Position (E: Emplacement) return Dimension is
	begin
		return E.Position;
	end Get_Position;
		
	function Creer (Id_Plaque : Natural; Position : Dimension) return Emplacement is
	begin
		return Emplacement'(Id_Plaque, Position);
	end Creer;
	
	procedure Deplacer (E: in out Emplacement; X,Y : in Integer) is
	begin
	   E.Position := Dim(Get_Largeur(E.Position) + X, Get_Hauteur(E.Position) + Y);
	end Deplacer;

	function ToString (Empl : Emplacement) return String is
	begin
	   if Empl.Id_Plaque = 0 then
	       return "inconnu"; -- Convention : la plaque #0 indique un emplacement inconnu
       else
	       return "Numéro de plaque : " & Natural_To_Str(Empl.Id_Plaque) & " Position : " & ToString(Empl.Position);
       end if;
	end ToString;
end Emplacements;